package cn.young.javalearning.designpattern.singleton.lazy;

public class LazyDoubleCheckSingleton {
    private static volatile LazyDoubleCheckSingleton lazyDoubleCheckSingleton;
    private LazyDoubleCheckSingleton(){}
    public static LazyDoubleCheckSingleton getInstance(){
            if(null == lazyDoubleCheckSingleton){
                synchronized (LazyDoubleCheckSingleton.class){
                    if(null == lazyDoubleCheckSingleton){
                        lazyDoubleCheckSingleton = new LazyDoubleCheckSingleton();
                    }
                }
            }
        return lazyDoubleCheckSingleton;
    }
}
